package com.lkxx.entity.handler;

import com.alibaba.excel.util.BooleanUtils;
import com.alibaba.excel.write.handler.CellWriteHandler;
import com.alibaba.excel.write.handler.context.CellWriteHandlerContext;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.CreationHelper;

/**
 * @Author: lkxx [mazhenjun.lk.xx@gmail.com]
 * @CreateTime: 2023-12-04  15:00
 * @Description: TODO
 * @Version: 1.0
 */
public class IntToStringWriterHandler implements CellWriteHandler {
    @Override
    public void afterCellDispose(CellWriteHandlerContext context) {
        Cell cell = context.getCell();
        Object curData = cell.getCellType() == CellType.STRING ? cell.getStringCellValue() : cell.getNumericCellValue();
        if (curData.toString().equals("0.0")) {
            context.getCell().setCellValue("");
        }
    }
}
